public class AccountStub extends Stub implements Account  {

	private int id;
	private int bankID;
	
	public AccountStub(int identifier, int bankIdentifier,String serverAddress){
		id = identifier;
		this.serverAddress = serverAddress;
		bankID = bankIdentifier;
	}
	
	public void deposit(double amount) {
		sendAndGetResponseMessage("/BANK/" + bankID + "/ACCOUNT/" + id + "/DEPOSIT/" + amount, false);
	}

	public double getBalance() {
		String response = sendAndGetResponseMessage("/BANK/" + bankID + "/ACCOUNT/" + id + "/BALANCE/", true);
		return Double.parseDouble(response);
	}

	public String getName() {
		return sendAndGetResponseMessage("/BANK/" + bankID + "/ACCOUNT/" + id + "/NAME/", true);
	}

	public void withdraw(double amount) {
		sendAndGetResponseMessage("/BANK/" + bankID + "/ACCOUNT/" + id + "/WITHDRAW/" + amount, false);
	}
}
